package com.diyphonegadgets.freeblog.network;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpParams;

public class HttpConnector {

	private static HttpParams httpParams;

	public final static HttpResponse getHttpResponse(HttpRequestBase request)
			throws ClientProtocolException, IOException {
		DefaultHttpClient client = new DefaultHttpClient(httpParams);
		org.apache.http.HttpResponse response = client.execute(request);
		HttpEntity entity = response.getEntity();
		return new HttpResponse(response.getStatusLine().getStatusCode(),
				response.getAllHeaders(), entity, client);
	}

}
